package com.boolib;

import com.alibaba.fastjson.JSON;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class Proxy implements InvocationHandler {
    private Object p ;

    public Proxy(Object p) {
        this.p = p;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println(JSON.toJSONString(proxy));
        return method.invoke(p,args);
    }


}
